#[derive(Debug)]
enum StepType {
    Request,
    API,
    TestCase,
    Transaction,
    Rendezvous,
    ThinkTime,
    WebSocket,
    Android,
    IOS,
}

#[derive(Debug)]
struct StepResult {
    name: String,
    start_time: i64,
    step_type: StepType,
    success: bool,
    elapsed_ms: i64,
    httpstat: Option<Vec<(String, i64)>>,
    data: Option<Box<dyn std::any::Any>>,
    content_size: i64,
    export_vars: Option<std::collections::HashMap<String, Box<dyn std::any::Any>>>,
    attachments: Option<Box<dyn std::any::Any>>,
}

#[derive(Debug)]
struct TStep {
    name: String,
    request: Option<Request>,
    api: Option<Box<dyn std::any::Any>>,
    testcase: Option<Box<dyn std::any::Any>>,
    transaction: Option<Transaction>,
    rendezvous: Option<Rendezvous>,
    think_time: Option<ThinkTime>,
    websocket: Option<WebSocketAction>,
    android: Option<MobileStep>,
    ios: Option<MobileStep>,
    variables: Option<std::collections::HashMap<String, Box<dyn std::any::Any>>>,
    setup_hooks: Option<Vec<String>>,
    teardown_hooks: Option<Vec<String>>,
    extract: Option<std::collections::HashMap<String, String>>,
    validators: Option<Vec<Box<dyn std::any::Any>>>,
    export: Option<Vec<String>>,
    loops: Option<i32>,
}

/// IStep represents interface for all types for teststeps, includes:
/// StepRequest, StepRequestWithOptionalArgs, StepRequestValidation, StepRequestExtraction,
/// StepTestCaseWithOptionalArgs,
/// StepTransaction, StepRendezvous, StepWebSocket.
trait IStep {
    fn name(&self) -> &str;
    fn step_type(&self) -> StepType;
    fn run(&self, runner: SessionRunner) -> Result<StepResult, Box<dyn std::error::Error>>;
}
